#define _CRT_SECURE_NO_WARNINGS	

char* compressString(char* s)
{
    int len1 = strlen(s);
    char* str = (char*)calloc(3 * len1, 1);
    char* pcur = s;
    int pos = 0;
    while (*pcur != '\0')
    {
        char* front = pcur + 1;
        while (*front == *pcur)
            front++;
        int Long = front - pcur;
        str[pos++] = *pcur;
        pos += sprintf(&str[pos], "%d", Long);
        pcur = front;
    }
    int len2 = strlen(str);
    return len1 > len2 ? str : s;
}